<template>
  <el-input v-model="currentValue" @change="handleChange"></el-input>
</template>

<script>
export default {
  name: 'ItemInput',
  componentName: 'ItemInput',
  data () {
    return {
      currentValue: this.value
    };
  },
  props: {
    value: [String, Number],
    row: {},
    type: String
  },
  methods: {
    handleChange (val) {
      this.$emit('input', val);
      this.$emit('change', this.type, val, this.row);
    }
  },
  watch: {
    value (val) {
      this.currentValue = val;
    }
  }
};
</script>
